<%@ Page language="vb" EnableViewStateMac="true" Inherits="_2bMatesSite.join" ValidateRequest=false CodeFile="join.aspx.vb" CodeFileBaseClass="_2bMatesSite.BaseWebPage" %>
<form id="Form1" method="post" runat="server">
<!-- begin form -->
<table cellSpacing="0" cellPadding="0" width="100%" align="center" border="0" height="100%">
	<tr>
		<td>
			<table cellspacing="0" cellpadding="0" width="100%" border="0" class="page_title" id="Table1">
				<tr>
					<td><asp:literal id="litTitle" runat="server">Sign Up</asp:literal></td>
					<td align="right"><asp:literal id="litRightLinks" runat="server"></asp:literal></td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td class="main_table_border"  vAlign="top">
			<div class="content">
				<table cellspacing="0" cellpadding="0" width="100%" border="0" class="main_text">
					<tr>
						<td align="left"><asp:Literal id="litTable" runat=server>
							<b> Link up with your friends on 2Bmates
							<br><br>
							2Bmates is FREE, and you're just a few finger taps away from joining!
							</b></asp:literal>
						</td>
					</tr>
				</table>
			</div>		
		</td>
	</tr>
	<tr>
		<td class="small" height="8">&nbsp;</td>
	</tr>	
	<tr>
		<td class="main_table_border" vAlign="top" height="100%">
			<div class="content">
				<table cellSpacing="0" cellPadding="0" width="100%" border="0" class="main_text_form">
					<tr>
						<td align="left" colSpan="3">
							<asp:literal id="litText" runat="server"><font class="notes_text">*</font>indicates required fields</asp:literal>
						</td>
					</tr>
					<tr>
						<td id="error" valign="top" align="left" colspan="3"><asp:validationsummary id="ValidationSummary1" runat="server" displaymode="List" cssclass="val_summary"></asp:validationsummary></td>
					</tr>
					<tr>
						<td><asp:label id="lblEmail" runat="server" CssClass="main_text_bold"> Email Address</asp:label>
						<asp:label id="lblEmailStar" runat="server" cssclass="main_text_err">*</asp:label>&nbsp;
						</td>
						<td><asp:textbox id="txtEmail" runat="server" Width="204px" CssClass="mail_field" MaxLength="50" ToolTip="Email Address" EnableViewState="False"></asp:textbox>
							<asp:requiredfieldvalidator id="rvTxtEmail" runat="server" Display="None" ErrorMessage="Please enter your email" ControlToValidate="txtEmail"></asp:requiredfieldvalidator>
							<asp:regularexpressionvalidator id="revTxtEmail" runat="server" Display="None" ErrorMessage="Please enter Correct Email" ControlToValidate="txtEmail" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:regularexpressionvalidator>
							<asp:label id="lblEmailValue" runat="server" Visible="False">Label</asp:label>
							<asp:customvalidator id="cvUserExist" runat="server" Display="None" ErrorMessage="The email address you entered is already registered"
								ControlToValidate="txtEmail"></asp:customvalidator></td>
						<td vAlign="top" rowSpan="5">
							<div>
								<table class="main_table_border" cellSpacing="0" cellPadding="0" width="99%" border="0">
									<tr>
										<td class="blue">
										<asp:literal id="litPrivacy" runat="server">
											<font class="main_text_err">Your Privacy:<br></font>
										</asp:literal>
										</td>
									</tr>
									<tr>
										<td class="blue">
										<asp:literal id="litNoSpam" runat="server">
										<b>2Bmates does NOT spam, sell or trade your information.</b>
										</asp:literal>
										</td>
									</tr>
									<tr>
										<td class="blue">
											<asp:literal id="litRead" runat="server">Please read our </asp:literal>
											<asp:hyperlink id="hlPrivacyPolicy" tabIndex="30" runat="server"  NavigateUrl="../privacy_policy.aspx"  cssclass="main_text_bold">Privacy Policy</asp:hyperlink>.
										</td>
									</tr>
								</table>
							</div>
							<asp:literal id="litReasons" runat="server">
							<br><br>
							&nbsp;&nbsp;<b>Reasons for joining 2Bmates:<br><br> 
							&nbsp;&nbsp;<img src="images/btn_arrow.gif" align="center"> &nbsp;Create a personlised Profile<br> 
							&nbsp;&nbsp;<img src="images/btn_arrow.gif" align="center"> &nbsp;Upload Photos<br> 
							&nbsp;&nbsp;<img src="images/btn_arrow.gif" align="center"> &nbsp;Send Mail<br> 
							&nbsp;&nbsp;<img src="images/btn_arrow.gif" align="center"> &nbsp;Share interests<br>
							&nbsp;&nbsp;<img src="images/btn_arrow.gif" align="center"> &nbsp;Write Blogs &amp; Comments<br>  
							&nbsp;&nbsp;<img src="images/btn_arrow.gif" align="center"> &nbsp;2Bmates is FREE</b>
							</asp:literal>
						</td>
					</tr>
    			<tr>
						<td><asp:label id="lblVerifyEmail" runat="server" CssClass="main_text_bold"> Verify Email Address</asp:label>
						<asp:label id="lblVerifyEmailStar" runat="server" cssclass="main_text_err">*</asp:label></td>
						<td><asp:textbox id="txtVerifyEmail" runat="server" Width="204px" CssClass="mail_field" MaxLength="50"
								ToolTip="Email Address" EnableViewState="False"></asp:textbox>
							<asp:requiredfieldvalidator id="rvTxtVerifyEmail" runat="server" Display="None" ErrorMessage="Please re-enter your email"
								ControlToValidate="txtVerifyEmail"></asp:requiredfieldvalidator>
							<asp:regularexpressionvalidator id="revTxtVerifyEmail" runat="server" Display="None" ErrorMessage="Please enter correct verification email"
								ControlToValidate="txtVerifyEmail" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:regularexpressionvalidator>
							<asp:customvalidator id="cvTxtEmail" runat="server" Display="None" ErrorMessage="Please check your email"
								ControlToValidate="txtVerifyEmail" ></asp:customvalidator></td>
					</tr>
					<tr>
						<td><asp:label id="lblFirstName" runat="server" CssClass="main_text_bold"> First Name</asp:label><font class="main_text_err">*</font><br></td>
						<td><asp:textbox id="txtFirstName" runat="server" Width="204px" CssClass="mail_field" MaxLength="50"
								ToolTip="First Name" EnableViewState="False"></asp:textbox>
							<asp:requiredfieldvalidator id="rvTxtFirstName" runat="server" Display="None" ErrorMessage="Please enter your first name"
								ControlToValidate="txtFirstName"></asp:requiredfieldvalidator><asp:customvalidator id="cvHtmlInFirstName" runat="server" controltovalidate="txtFirstName" errormessage="HTML is not allowed in First Name field"
						display="None"></asp:customvalidator></td>
					</tr>
					<tr>
						<td><asp:label id="lblLastName" runat="server" CssClass="main_text_bold"> Last Name</asp:label><font class="main_text_err">*</font><br></td>
						<td><asp:textbox id="txtLastName" runat="server" Width="204px" CssClass="mail_field" MaxLength="50"
								ToolTip="Last Name" EnableViewState="False"></asp:textbox>
							<asp:requiredfieldvalidator id="rvTxtLastName" runat="server" Display="None" ErrorMessage="Please enter your last name"
								ControlToValidate="txtLastName"></asp:requiredfieldvalidator><asp:customvalidator id="cvHtmlInLastName" runat="server" controltovalidate="txtLastName" errormessage="HTML is not allowed in Last Name field"
						display="None"></asp:customvalidator></td>
					</tr>
					<tr>
						<td><asp:label id="lblPassword" runat="server" CssClass="main_text_bold"> Password</asp:label>
						<asp:label id="lblPasswordStar" runat="server" cssclass="main_text_err">*</asp:label></td>
						<td><asp:textbox id="txtPassword" runat="server" Width="204px" CssClass="mail_field" MaxLength="10"
								ToolTip="Password" EnableViewState="False" TextMode="Password"></asp:textbox>
							<asp:requiredfieldvalidator id="rvTxtPassword" runat="server" Display="None" ErrorMessage="Please enter your password"
								ControlToValidate="txtPassword"></asp:requiredfieldvalidator><asp:customvalidator id="cvHtmlInPassword" runat="server" controltovalidate="txtPassword" errormessage="HTML is not allowed in Password field"
						display="None"></asp:customvalidator><br>(Password max 10 characters)</td>
					</tr>
					<tr>
						<td><asp:label id="lblPasswordAgain" runat="server" CssClass="main_text_bold"> Enter Password Again</asp:label>
						<asp:label id="lblPasswordAgainStar" runat="server" cssclass="main_text_err">*</asp:label></td>
						<td colSpan="2"><asp:textbox id="txtPasswordAgain" runat="server" Width="204px" CssClass="mail_field" MaxLength="10"
								ToolTip="Password Again" EnableViewState="False" TextMode="Password"></asp:textbox>
								<asp:requiredfieldvalidator id="rvTxtPasswordAgain" runat="server" Display="None" ErrorMessage="Please re-enter your password"
								ControlToValidate="txtPasswordAgain"></asp:requiredfieldvalidator>
								<asp:comparevalidator id="cvTxtPassword" runat="server" Display="None" ErrorMessage="Please check your password"
								ControlToValidate="txtPasswordAgain" ControlToCompare="txtPassword"></asp:comparevalidator><asp:customvalidator id="cvHtmlInPasswordAgain" runat="server" controltovalidate="txtPassword" errormessage="HTML is not allowed in Password Again field"
						display="None"></asp:customvalidator><br>(Password max 10 characters)</td>
					</tr>
					<tr>
						<td><asp:label id="lblGender" runat="server" CssClass="main_text_bold">Gender</asp:label><font class="main_text_err">*</font><br>
						</td>
						<td align="left" colSpan="2"><asp:radiobutton id="rbMale" onclick="javascript:client_CheckedChanged(this);" runat="server" value="1"
								GroupName="grpGender" oncheckedchanged="rbMale_CheckedChanged"></asp:radiobutton><font class="radio_text"><asp:Label id="lbRBlMale" runat="server">Male</asp:Label></font><asp:radiobutton id="rbFemale" onclick="javascript:client_CheckedChanged(this);" runat="server" value="2"
								GroupName="grpGender" TextAlign="Left" oncheckedchanged="rbFemale_CheckedChanged"></asp:radiobutton><font class="radio_text">&nbsp;<asp:Label id="lbRBlFemale" runat="server">Female</asp:Label></font>
							<asp:textbox id="txtHiddenGender" style="DISPLAY: none" runat="server"
								Width="1px" Height="1px"></asp:textbox><asp:requiredfieldvalidator id="rvTxtHiddenGender" runat="server" Display="None" ErrorMessage="Please choose your gender"
								ControlToValidate="txtHiddenGender"></asp:requiredfieldvalidator></td>
					</tr>
					<tr>
						<td><asp:label id="lblDateOfBirth" runat="server" Font-Bold="True" CssClass="main_text_bold"> Date of Birth</asp:label><font class="notes_text">*</font></td>
						<td colSpan="2" height="42"><asp:dropdownlist id=ddlDay runat="server" CssClass="date_field" DataSource="<%# Page %>">
								<asp:ListItem Value="0">Day</asp:ListItem>
							</asp:dropdownlist>&nbsp;
							<asp:dropdownlist id=ddlMonth runat="server" CssClass="date_field" DataSource="<%# Page %>">
								<asp:ListItem Value="0">Month</asp:ListItem>
							</asp:dropdownlist>&nbsp;
							<asp:dropdownlist id=ddlYear runat="server" CssClass="date_field" DataSource="<%# Page %>">
								<asp:ListItem Value="0">Year</asp:ListItem>
							</asp:dropdownlist><asp:customvalidator id="valDate" runat="server" Display="None" ErrorMessage="Please enter your correct birth date"
								ControlToValidate="ddlYear" ClientValidationFunction="client_validateDate" Runat="server" OnServerValidate="GenerateDate"></asp:customvalidator><asp:textbox id="txtDateOfBirth" style="DISPLAY: none" runat="server"
								Width="1px" Height="1px">00/00/00</asp:textbox>
								<asp:regularexpressionvalidator id="revHiddenDate" runat="server" Display="None" ErrorMessage="Please enter correct birth date"
								ControlToValidate="txtDateOfBirth" ValidationExpression="(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.]((19|20)\d\d)"></asp:regularexpressionvalidator></td>
					</tr>
					<tr>
						<td><asp:label id="lblCountry" runat="server" CssClass="main_text_bold" Font-Bold="True">Country</asp:label><font class="main_text_err">*</font><br></td>
						<td colSpan="2" height="4"><asp:dropdownlist id=ddlCountry runat="server" CssClass="scrollbar" Width="212px" DataSource="<%# Page %>"></asp:dropdownlist></td>
					</tr>
					<tr>
						<td><asp:label id="lblZip" runat="server" CssClass="main_text_bold" Font-Bold="True">Zip/Postal Code</asp:label></td>
						<td colSpan="2"><asp:textbox id="txtZip" runat="server" CssClass="mail_field" Width="204px" Rows="1" MaxLength="10"></asp:textbox>&nbsp;&nbsp;
						<asp:customvalidator id="cvZip" runat="server" ControlToValidate="ddlCountry" ErrorMessage="Please enter Zip/Postal  Code"
								Display="None"></asp:customvalidator><asp:customvalidator id="cvHtmlInZip" runat="server" controltovalidate="txtZip" errormessage="HTML is not allowed in Zip/Postal Code field"
						display="None"></asp:customvalidator></td>
					</tr>
					<tr>
						<td vAlign="top" colSpan="3"><br><img src="images/spacer.gif" width="100%" height="1" class="spacer_color"></td>
					</tr>
					<tr>
						<td colSpan="3"><br>
							<asp:label id="lblReferrer" runat="server" Font-Bold="True" CssClass="main_text_bold">If a friend referred you, please enter their email address:&nbsp;&nbsp;</asp:label><asp:textbox id="txtReferrer" runat="server" Width="204px" CssClass="mail_field" MaxLength="50"
								EnableViewState="False"></asp:textbox>
								<asp:label id="lblReferrerValue" runat="server" Visible="False">Label</asp:label>
								<asp:regularexpressionvalidator id="revTxtReferrer" runat="server" Display="None" ErrorMessage="Please enter a valid referrer's email"
								ControlToValidate="txtReferrer" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:regularexpressionvalidator>&nbsp;&nbsp;
								<asp:label id="lblExample" runat="server" CssClass="mail_address">(ex. user@domain.com)</asp:label></td>
					</tr>
					<tr>
						<td colSpan="3"><br><asp:label id="lblReferrerExplain" runat="server"> 2Bmates will automatically connect you to your friend.</asp:label></td>
					</tr>
					<tr>
						<td colSpan="3"><br><img src="images/spacer.gif" width="100%" height="1" class="spacer_color"><br></td>
					</tr>
					<tr>
						<td colSpan="3"><asp:label id="lblAgree" runat="server">By clicking 'Sign Me Up' you agree to our <a href="terms.aspx">Terms</a>.</asp:label><br><br></td>
					</tr>
					<tr>
						<td align="right" colSpan="3"><asp:button id="btnSignMeUp" runat="server" Width="100px" CssClass="btn" Text="Sign Me Up"  onmouseover="ButtonMouseOver(this);" onmouseout="ButtonMouseOut(this);" onclick="btnSignMeUp_Click"></asp:button></td>
					</tr>
				</table>
			</div>		
		</td>
	</tr>
</table>
</form>
<!-- end form -->
<!-- end privacy -->
<script language="JavaScript">
	function client_validateDate(oSrc, args) {
		var day = document.forms[0]['_ctl0_ddlDay'].value;
		var month = document.forms[0]['_ctl0_ddlMonth'].value;
		var year = document.forms[0]['_ctl0_ddlYear'].value;
		
		if (!isDate(day, month, year)){
			args.isValid=false;
		}else{
			if(day.length == 1)
				day = "0" + day;
			if(month.length == 1)
				month = "0" + month;					
				
			document.forms[0]['_ctl0_txtDateOfBirth'].value = month + "/" + day + "/" + year;
			args.isValid=true;
		}
	}
	
	function client_CheckedChanged(radiobutton){
		if (radiobutton.checked){
				document.forms[0]['_ctl0_txtHiddenGender'].value = radiobutton.value;
		}
	}
	
function isDate(strDay,strMonth,strYear){
	var daysInMonth = DaysArray(12);
	month = parseInt(strMonth);
	day = parseInt(strDay);
	year = parseInt(strYear);	
	minYear = 1920
	maxYear = 2005
	if( (strMonth.length < 1) || (month < 1) || (month > 12) ){
		return false;
	}else if( (strDay.length < 1) || (day < 1) || (day > 31) || 
	         ((month == 2) && (day > daysInFebruary(year))) || (day > daysInMonth[month]) ){
	  return false;
	}else if( (strYear.length != 4) || (year == 0) || (year < minYear) || (year > maxYear) ){
		return false;
	}else{
    return true;	
	}	
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
  // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}

function DaysArray(n){
	for( var i = 1; i <= n; i++ ){
		this[i] = 31;
		if ( (i == 4) || (i == 6) || (i == 9) || (i == 11) ) {
		  this[i] = 30;
		}else if( i == 2 ){
		  this[i] = 29;
		}
  } 
  return this;
}	
</script>

